﻿<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
    <title>自动移动文件</title>
    <meta name="keywords" content="蟑螂•魂">
    <meta name="description" content="自动移动文件 蟑螂•魂">
    <meta name="author" content="蟑螂•魂">
    <meta name="robots" content="none">
    <meta name="generator" content="Microsoft Visual Studio 2022">
    <meta name="copyright" content="Copyright @蟑螂•魂 2023">
    <meta http-equiv="pragma" content="no-cache">
    <base target="_self">
    <link rel="shortcut icon" href="img/favicon.ico">
    <link rel="apple-touch-icon" href="img/touchicon.png">
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/main.css" />
</head>
<body>
    <div class="container-fluid">
        <form class="mt-3">
            <div class="row mb-2">
                <label for="txtMonitorDirectories" class="col-sm-auto col-form-label">监视目录</label>
                <div class="col-sm">
                    <div class="input-group">
                        <div class="form-floating">
                            <input class="form-control" type="text" placeholder="请选择需要执行自动移动文件的监视目录..." aria-label="请选择需要执行自动移动文件的监视目录..." aria-describedby="btnMonitorDirectories" id="txtMonitorDirectories" required>
                            <label for="txtMonitorDirectories">请选择需要执行自动移动文件的监视目录...</label>
                        </div>
                        <button class="btn btn-outline-secondary" type="button" id="btnMonitorDirectories" onclick="onBrowserDirectories()">浏览...</button>
                    </div>
                </div>
            </div>

            <div class="row mb-3">
                <label for="chkIncludeSubdirectories" class="col-sm-auto col-form-label pt-0 invisible">含子目录</label>
                <div class="col-sm-auto">
                    <div class="form-check form-switch">
                        <input class="form-check-input" type="checkbox" role="switch" id="chkIncludeSubdirectories" checked>
                        <label class="form-check-label" for="chkIncludeSubdirectories">是否包含子目录</label>
                    </div>
                </div>
                <div class="col-sm-auto">
                    <div class="form-check form-switch">
                        <input class="form-check-input" type="checkbox" role="switch" id="chkCleanEmptyFolder" checked>
                        <label class="form-check-label" for="chkCleanEmptyFolder">是否清理所有层级的空目录</label>
                    </div>
                </div>
            </div>

            <div class="row mb-3">
                <label for="txtTargetDirectories" class="col-sm-auto col-form-label">目标目录</label>
                <div class="col-sm">
                    <div class="input-group">
                        <div class="form-floating">
                            <input class="form-control" type="text" placeholder="请选择需要执行自动移动文件的目标目录..." aria-label="请选择需要执行自动移动文件的目标目录..." aria-describedby="btnTargetDirectories" id="txtTargetDirectories" required>
                            <label for="txtTargetDirectories">请选择需要执行自动移动文件的目标目录...</label>
                        </div>
                        <button class="btn btn-outline-secondary" type="button" id="btnTargetDirectories" onclick="onBrowserTargetFolder()">浏览...</button>
                    </div>
                </div>
            </div>

            <div class="row mb-3">
                <label for="chkExcludeHiddenFiles" class="col-sm-auto col-form-label pt-0">排除选项</label>
                <div class="col-sm-auto">
                    <div class="form-check form-switch">
                        <input class="form-check-input" type="checkbox" role="switch" id="chkExcludeHiddenFiles" checked>
                        <label class="form-check-label" for="chkExcludeHiddenFiles">排除隐藏文件和文件夹</label>
                    </div>
                </div>
                <div class="col-sm-auto">
                    <div class="form-check form-switch">
                        <input class="form-check-input" type="checkbox" role="switch" id="chkExcludeSystemFiles" checked>
                        <label class="form-check-label" for="chkExcludeSystemFiles">排除系统文件和文件夹</label>
                    </div>
                </div>
                <div class="col-sm-auto">
                    <div class="form-check form-switch">
                        <input class="form-check-input" type="checkbox" role="switch" id="chkExcludeTemporaryFiles" checked>
                        <label class="form-check-label" for="chkExcludeTemporaryFiles">排除临时文件和文件夹</label>
                    </div>
                </div>
            </div>

            <div class="row mb-3">
                <label for="txtCycleTimeDelay" class="col-sm-auto col-form-label">轮循周期</label>
                <div class="col-sm">
                    <div class="input-group">
                        <div class="form-floating">
                            <input class="form-control" type="time" value="00:05:00" step="1" min="00:00:10" placeholder="距离上一次成功执行后，需要延迟执行的时间。" aria-label="距离上一次成功执行后，需要延迟执行的时间。" aria-describedby="lblCycleTimeDelay" id="txtCycleTimeDelay" required>
                            <label for="txtCycleTimeDelay" id="lblCycleTimeDelay">下次需要延迟执行的时间</label>
                        </div>
                    </div>
                </div>

                <label for="txtLeadTime" class="col-sm-auto col-form-label">前置时间</label>
                <div class="col-sm">
                    <div class="input-group">
                        <div class="form-floating w-25">
                            <input class="form-control" type="number" value="0" placeholder="几天前" aria-label="几天前" aria-describedby="lblLeadDay" id="txtLeadDay" required>
                            <label for="txtLeadDay" id="lblLeadDay">几天前</label>
                        </div>
                        <div class="form-floating w-75">
                            <input class="form-control" type="time" value="00:30:00" step="1" min="00:00:10" placeholder="移动距离当前时间，前置多少时间之前的文件。" aria-label="移动距离当前时间，前置多少时间之前的文件。" aria-describedby="btnLeadTime" id="txtLeadTime" required>
                            <label for="txtLeadTime">移动多少时间之前的</label>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row mb-3">
                <label for="txtIncludeContent" class="col-sm-auto col-form-label">包含内容</label>
                <div class="col-sm">
                    <div class="card">
                        <div class="card-body p-2">
                            <div class="input-group mb-2">
                                <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" id="sltIncludeContent">文件</button>
                                <ul class="dropdown-menu">
                                    <li><a class="dropdown-item" href="#" onclick="onIncludeUnitChange('目录')">目录</a></li>
                                    <li><hr class="dropdown-divider"></li>
                                    <li><a class="dropdown-item" href="#" onclick="onIncludeUnitChange('文件')">文件</a></li>
                                    <li><a class="dropdown-item" href="#" onclick="onIncludeUnitChange('类型')">类型</a></li>
                                </ul>
                                <input type="text" class="form-control" placeholder="要包含的内容..." aria-label="要包含的内容..." aria-describedby="btnIncludeContent" id="txtIncludeContent">
                                <button class="btn btn-outline-secondary" type="button" id="btnIncludeContent" onclick="onIncludeAddin()">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-hammer" viewBox="0 0 16 16">
                                        <path d="M9.972 2.508a.5.5 0 0 0-.16-.556l-.178-.129a5.009 5.009 0 0 0-2.076-.783C6.215.862 4.504 1.229 2.84 3.133H1.786a.5.5 0 0 0-.354.147L.146 4.567a.5.5 0 0 0 0 .706l2.571 2.579a.5.5 0 0 0 .708 0l1.286-1.29a.5.5 0 0 0 .146-.353V5.57l8.387 8.873A.5.5 0 0 0 14 14.5l1.5-1.5a.5.5 0 0 0 .017-.689l-9.129-8.63c.747-.456 1.772-.839 3.112-.839a.5.5 0 0 0 .472-.334z" />
                                    </svg>
                                </button>
                            </div>
                            <ul class="list-group list-group-flush overflow-y-auto" style="height:245px;" data-bind="foreach: dataIncludeList">
                                <li class="list-group-item d-flex justify-content-between align-items-center ps-0 pe-0">
                                    <p class="text-break" data-bind="text: $data"></p>
                                    <button type="button" class="btn-close" aria-label="Close" data-bind="click: $parent.fireIncludeRemove"></button>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>

                <label for="txtExcludeContent" class="col-sm-auto col-form-label">排除内容</label>
                <div class="col-sm">
                    <div class="card">
                        <div class="card-body p-2">
                            <div class="input-group mb-2">
                                <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" id="sltExcludeContent">文件</button>
                                <ul class="dropdown-menu">
                                    <li><a class="dropdown-item" href="#" onclick="onExcludeUnitChange('目录')">目录</a></li>
                                    <li><hr class="dropdown-divider"></li>
                                    <li><a class="dropdown-item" href="#" onclick="onExcludeUnitChange('文件')">文件</a></li>
                                    <li><a class="dropdown-item" href="#" onclick="onExcludeUnitChange('类型')">类型</a></li>
                                </ul>
                                <input type="text" class="form-control" placeholder="要排除的内容..." aria-label="要排除的内容..." aria-describedby="btnExcludeContent" id="txtExcludeContent">
                                <button class="btn btn-outline-secondary" type="button" id="btnExcludeContent" onclick="onExcludeAddin()">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-hammer" viewBox="0 0 16 16">
                                        <path d="M9.972 2.508a.5.5 0 0 0-.16-.556l-.178-.129a5.009 5.009 0 0 0-2.076-.783C6.215.862 4.504 1.229 2.84 3.133H1.786a.5.5 0 0 0-.354.147L.146 4.567a.5.5 0 0 0 0 .706l2.571 2.579a.5.5 0 0 0 .708 0l1.286-1.29a.5.5 0 0 0 .146-.353V5.57l8.387 8.873A.5.5 0 0 0 14 14.5l1.5-1.5a.5.5 0 0 0 .017-.689l-9.129-8.63c.747-.456 1.772-.839 3.112-.839a.5.5 0 0 0 .472-.334z" />
                                    </svg>
                                </button>
                            </div>

                            <ul class="list-group list-group-flush overflow-y-auto" style="height:245px;" data-bind="foreach: dataExcludeList">
                                <li class="list-group-item d-flex justify-content-between align-items-center ps-0 pe-0">
                                    <p class="text-break" data-bind="text: $data"></p>
                                    <button type="button" class="btn-close" aria-label="Close" data-bind="click: $parent.fireExcludeRemove"></button>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>

            <div class="text-success">
                <hr>
            </div>

            <div class="row me-3">
                <div class="col-sm-6">
                    <div class="row">
                        <label for="txtWorkerThreads" class="col-sm-auto col-form-label">工作线程</label>
                        <div class="col-sm">
                            <input type="number" class="form-control w-25" value="1" min="1" max="20" id="txtWorkerThreads" required disabled>
                        </div>
                    </div>
                </div>
                <div class="col-sm-3 d-grid">
                    <button type="button" class="btn btn-primary" id="btnStart" onclick="onStart()">启动</button>
                </div>
                <div class="col-sm-3 d-grid">
                    <button type="button" class="btn btn-danger" id="btnStop" disabled onclick="onStop()">停止</button>
                </div>
            </div>
        </form>
    </div>

    <script src="assets/jquery/jquery.slim.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="assets/sweetalert/sweetalert.min.js"></script>
    <script src="assets/knockout/knockout-3.5.1.min.js"></script>
    <script src="js/main.js"></script>
</body>
</html>